﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using PSI.Helper;
using PSI.Models;
using PSI.Services;

namespace PSI.Controllers
{
    public class AccountTitleAdminController : PSIController
    {
        //
        // GET: /AccountTitleAdmin/

        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult AddAccountTitle(AccountTitle model) {

            var result = new AccountTitleService().AddItemAT(model);

            return Json(result);
        }

        [HttpPost]
        public ActionResult GetATTree(string atname) {

            var result = new AccountTitleService().GetTreeByName(atname);

            return Json(result);
        
        }

        [HttpPost]
        public ActionResult DelAT(AccountTitle model) {

            var result = new AccountTitleService().DeleteItem(model);

            return Json(result);
        
        }

    }
}
